package com.iris.live.services.data.models;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Date;

/**
 * Created by HangLiu on 2017/2/23.
 */
@Entity
@Table(name = "income_adjustment", schema = "live", catalog = "")
public class IncomeAdjustmentModel {
    private Integer id;
    private String permit;
    private Integer carCode;
    private String type;
    private Integer stockCode;
    private Date adjustDate;
    private BigDecimal siAdjust;//差值
    private BigDecimal siAdjustBefor;//之前SI预估成本
    private BigDecimal siAdjustReal;//实际SI
    private BigDecimal financeSoftLoanAdjust;//金融手续费
    private BigDecimal financeSoftLoanAdjustBefor;
    private BigDecimal financeSoftLoanAdjustReal;
    private BigDecimal financePoundageAdjust;//金融贴息
    private BigDecimal financePoundageAdjustBefor;
    private BigDecimal financePoundageAdjustReal;
    private BigDecimal insurancePoundageAdjust;//保险手续费
    private BigDecimal insurancePoundageAdjustBefor;
    private BigDecimal insurancePoundageAdjustReal;
    private BigDecimal afterMarketProductCostAdjust;//后市场赠送
    private BigDecimal afterMarketProductCostAdjustBefor;
    private BigDecimal afterMarketProductCostAdjustReal;
    private BigDecimal fiveStarsExtendCostAdjust;//五星/厂家延保
    private BigDecimal fiveStarsExtendCostAdjustBefor;
    private BigDecimal fiveStarsExtendCostAdjustReal;
    private BigDecimal thirdExtendCostAdjust;//第三方延保
    private BigDecimal thirdExtendCostAdjustBefor;
    private BigDecimal thirdExtendCostAdjustReal;
    private String lastUpdateUser;
    private Date lastUpdateDate;
    private Boolean give;//是否赠送
    private BigDecimal afterMarketProductCostBuyAdjust;//后市场非赠送
    private BigDecimal afterMarketProductCostBuyAdjustBefor;
    private BigDecimal afterMarketProductCostBuyAdjustReal;
    private Date validStartDate;//生效时间
    private Date validEndDate;//截止时间
    private Integer pNum; //批次号定位所处子项

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Basic
    @Column(name = "permit")
    public String getPermit() {
        return permit;
    }

    public void setPermit(String permit) {
        this.permit = permit;
    }

    @Basic
    @Column(name = "car_code")
    public Integer getCarCode() {
        return carCode;
    }

    public void setCarCode(Integer carCode) {
        this.carCode = carCode;
    }

    @Basic
    @Column(name = "type")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Basic
    @Column(name = "stock_code")
    public Integer getStockCode() {
        return stockCode;
    }

    public void setStockCode(Integer stockCode) {
        this.stockCode = stockCode;
    }

    @Basic
    @Column(name = "adjust_date")
    public Date getAdjustDate() {
        return adjustDate;
    }

    public void setAdjustDate(Date adjustDate) {
        this.adjustDate = adjustDate;
    }

    @Basic
    @Column(name = "si_adjust")
    public BigDecimal getSiAdjust() {
        return siAdjust;
    }

    public void setSiAdjust(BigDecimal siAdjust) {
        this.siAdjust = siAdjust;
    }

    @Basic
    @Column(name = "finance_soft_loan_adjust")
    public BigDecimal getFinanceSoftLoanAdjust() {
        return financeSoftLoanAdjust;
    }

    public void setFinanceSoftLoanAdjust(BigDecimal financeSoftLoanAdjust) {
        this.financeSoftLoanAdjust = financeSoftLoanAdjust;
    }

    @Basic
    @Column(name = "finance_poundage_adjust")
    public BigDecimal getFinancePoundageAdjust() {
        return financePoundageAdjust;
    }

    public void setFinancePoundageAdjust(BigDecimal financePoundageAdjust) {
        this.financePoundageAdjust = financePoundageAdjust;
    }

    @Basic
    @Column(name = "insurance_poundage_adjust")
    public BigDecimal getInsurancePoundageAdjust() {
        return insurancePoundageAdjust;
    }

    public void setInsurancePoundageAdjust(BigDecimal insurancePoundageAdjust) {
        this.insurancePoundageAdjust = insurancePoundageAdjust;
    }

    @Basic
    @Column(name = "after_market_product_cost_adjust")
    public BigDecimal getAfterMarketProductCostAdjust() {
        return afterMarketProductCostAdjust;
    }

    public void setAfterMarketProductCostAdjust(BigDecimal afterMarketProductCostAdjust) {
        this.afterMarketProductCostAdjust = afterMarketProductCostAdjust;
    }

    @Basic
    @Column(name = "five_stars_extend_cost_adjust")
    public BigDecimal getFiveStarsExtendCostAdjust() {
        return fiveStarsExtendCostAdjust;
    }

    public void setFiveStarsExtendCostAdjust(BigDecimal fiveStarsExtendCostAdjust) {
        this.fiveStarsExtendCostAdjust = fiveStarsExtendCostAdjust;
    }

    @Basic
    @Column(name = "last_update_user")
    public String getLastUpdateUser() {
        return lastUpdateUser;
    }

    public void setLastUpdateUser(String lastUpdateUser) {
        this.lastUpdateUser = lastUpdateUser;
    }

    @Basic
    @Column(name = "last_update_date")
    public Date getLastUpdateDate() {
        return lastUpdateDate;
    }

    public void setLastUpdateDate(Date lastUpdateDate) {
        this.lastUpdateDate = lastUpdateDate;
    }

    @Basic
    @Column(name = "si_adjust_befor")
    public BigDecimal getSiAdjustBefor() {
        return siAdjustBefor;
    }

    public void setSiAdjustBefor(BigDecimal siAdjustBefor) {
        this.siAdjustBefor = siAdjustBefor;
    }

    @Basic
    @Column(name = "si_adjust_real")
    public BigDecimal getSiAdjustReal() {
        return siAdjustReal;
    }

    public void setSiAdjustReal(BigDecimal siAdjustReal) {
        this.siAdjustReal = siAdjustReal;
    }

    @Basic
    @Column(name = "finance_soft_loan_adjust_befor")
    public BigDecimal getFinanceSoftLoanAdjustBefor() {
        return financeSoftLoanAdjustBefor;
    }

    public void setFinanceSoftLoanAdjustBefor(BigDecimal financeSoftLoanAdjustBefor) {
        this.financeSoftLoanAdjustBefor = financeSoftLoanAdjustBefor;
    }

    @Basic
    @Column(name = "finance_soft_loan_adjust_real")
    public BigDecimal getFinanceSoftLoanAdjustReal() {
        return financeSoftLoanAdjustReal;
    }

    public void setFinanceSoftLoanAdjustReal(BigDecimal financeSoftLoanAdjustReal) {
        this.financeSoftLoanAdjustReal = financeSoftLoanAdjustReal;
    }

    @Basic
    @Column(name = "finance_poundage_adjust_befor")
    public BigDecimal getFinancePoundageAdjustBefor() {
        return financePoundageAdjustBefor;
    }

    public void setFinancePoundageAdjustBefor(BigDecimal financePoundageAdjustBefor) {
        this.financePoundageAdjustBefor = financePoundageAdjustBefor;
    }

    @Basic
    @Column(name = "finance_poundage_adjust_real")
    public BigDecimal getFinancePoundageAdjustReal() {
        return financePoundageAdjustReal;
    }

    public void setFinancePoundageAdjustReal(BigDecimal financePoundageAdjustReal) {
        this.financePoundageAdjustReal = financePoundageAdjustReal;
    }

    @Basic
    @Column(name = "insurance_poundage_adjust_befor")
    public BigDecimal getInsurancePoundageAdjustBefor() {
        return insurancePoundageAdjustBefor;
    }

    public void setInsurancePoundageAdjustBefor(BigDecimal insurancePoundageAdjustBefor) {
        this.insurancePoundageAdjustBefor = insurancePoundageAdjustBefor;
    }

    @Basic
    @Column(name = "insurance_poundage_adjust_real")
    public BigDecimal getInsurancePoundageAdjustReal() {
        return insurancePoundageAdjustReal;
    }

    public void setInsurancePoundageAdjustReal(BigDecimal insurancePoundageAdjustReal) {
        this.insurancePoundageAdjustReal = insurancePoundageAdjustReal;
    }

    @Basic
    @Column(name = "after_market_product_cost_adjust_befor")
    public BigDecimal getAfterMarketProductCostAdjustBefor() {
        return afterMarketProductCostAdjustBefor;
    }

    public void setAfterMarketProductCostAdjustBefor(BigDecimal afterMarketProductCostAdjustBefor) {
        this.afterMarketProductCostAdjustBefor = afterMarketProductCostAdjustBefor;
    }

    @Basic
    @Column(name = "after_market_product_cost_adjust_real")
    public BigDecimal getAfterMarketProductCostAdjustReal() {
        return afterMarketProductCostAdjustReal;
    }

    public void setAfterMarketProductCostAdjustReal(BigDecimal afterMarketProductCostAdjustReal) {
        this.afterMarketProductCostAdjustReal = afterMarketProductCostAdjustReal;
    }

    @Basic
    @Column(name = "five_stars_extend_cost_adjust_befor")
    public BigDecimal getFiveStarsExtendCostAdjustBefor() {
        return fiveStarsExtendCostAdjustBefor;
    }

    public void setFiveStarsExtendCostAdjustBefor(BigDecimal fiveStarsExtendCostAdjustBefor) {
        this.fiveStarsExtendCostAdjustBefor = fiveStarsExtendCostAdjustBefor;
    }

    @Basic
    @Column(name = "five_stars_extend_cost_adjust_real")
    public BigDecimal getFiveStarsExtendCostAdjustReal() {
        return fiveStarsExtendCostAdjustReal;
    }

    public void setFiveStarsExtendCostAdjustReal(BigDecimal fiveStarsExtendCostAdjustReal) {
        this.fiveStarsExtendCostAdjustReal = fiveStarsExtendCostAdjustReal;
    }

    @Basic
    @Column(name = "third_extend_cost_adjust")
    public BigDecimal getThirdExtendCostAdjust() {
        return thirdExtendCostAdjust;
    }

    public void setThirdExtendCostAdjust(BigDecimal thirdExtendCostAdjust) {
        this.thirdExtendCostAdjust = thirdExtendCostAdjust;
    }

    @Basic
    @Column(name = "third_extend_cost_adjust_befor")
    public BigDecimal getThirdExtendCostAdjustBefor() {
        return thirdExtendCostAdjustBefor;
    }

    public void setThirdExtendCostAdjustBefor(BigDecimal thirdExtendCostAdjustBefor) {
        this.thirdExtendCostAdjustBefor = thirdExtendCostAdjustBefor;
    }

    @Basic
    @Column(name = "third_extend_cost_adjust_real")
    public BigDecimal getThirdExtendCostAdjustReal() {
        return thirdExtendCostAdjustReal;
    }

    public void setThirdExtendCostAdjustReal(BigDecimal thirdExtendCostAdjustReal) {
        this.thirdExtendCostAdjustReal = thirdExtendCostAdjustReal;
    }

    @Basic
    @Column(name = "valid_start_date")
    public Date getValidStartDate() {
        return validStartDate;
    }

    public void setValidStartDate(Date validStartDate) {
        this.validStartDate = validStartDate;
    }

    @Basic
    @Column(name = "valid_end_date")
    public Date getValidEndDate() {
        return validEndDate;
    }

    public void setValidEndDate(Date validEndDate) {
        this.validEndDate = validEndDate;
    }

    @Basic
    @Column(name = "p_num")
    public Integer getpNum() {
        return pNum;
    }

    public void setpNum(Integer pNum) {
        this.pNum = pNum;
    }

    @Basic
    @Column(name = "is_give")
    public Boolean getGive() {
        return give;
    }

    public void setGive(Boolean give) {
        this.give = give;
    }

    @Basic
    @Column(name = "after_market_product_cost_buy_adjust")
    public BigDecimal getAfterMarketProductCostBuyAdjust() {
        return afterMarketProductCostBuyAdjust;
    }

    public void setAfterMarketProductCostBuyAdjust(BigDecimal afterMarketProductCostBuyAdjust) {
        this.afterMarketProductCostBuyAdjust = afterMarketProductCostBuyAdjust;
    }

    @Basic
    @Column(name = "after_market_product_cost_buy_adjust_befor")
    public BigDecimal getAfterMarketProductCostBuyAdjustBefor() {
        return afterMarketProductCostBuyAdjustBefor;
    }

    public void setAfterMarketProductCostBuyAdjustBefor(BigDecimal afterMarketProductCostBuyAdjustBefor) {
        this.afterMarketProductCostBuyAdjustBefor = afterMarketProductCostBuyAdjustBefor;
    }

    @Basic
    @Column(name = "after_market_product_cost_buy_adjust_real")
    public BigDecimal getAfterMarketProductCostBuyAdjustReal() {
        return afterMarketProductCostBuyAdjustReal;
    }

    public void setAfterMarketProductCostBuyAdjustReal(BigDecimal afterMarketProductCostBuyAdjustReal) {
        this.afterMarketProductCostBuyAdjustReal = afterMarketProductCostBuyAdjustReal;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        IncomeAdjustmentModel that = (IncomeAdjustmentModel) o;

        if (id != null ? !id.equals(that.id) : that.id != null) return false;
        if (permit != null ? !permit.equals(that.permit) : that.permit != null) return false;
        if (carCode != null ? !carCode.equals(that.carCode) : that.carCode != null) return false;
        if (type != null ? !type.equals(that.type) : that.type != null) return false;
        if (stockCode != null ? !stockCode.equals(that.stockCode) : that.stockCode != null) return false;
        if (adjustDate != null ? !adjustDate.equals(that.adjustDate) : that.adjustDate != null) return false;
        if (siAdjust != null ? !siAdjust.equals(that.siAdjust) : that.siAdjust != null) return false;
        if (financeSoftLoanAdjust != null ? !financeSoftLoanAdjust.equals(that.financeSoftLoanAdjust) : that.financeSoftLoanAdjust != null)
            return false;
        if (financePoundageAdjust != null ? !financePoundageAdjust.equals(that.financePoundageAdjust) : that.financePoundageAdjust != null)
            return false;
        if (insurancePoundageAdjust != null ? !insurancePoundageAdjust.equals(that.insurancePoundageAdjust) : that.insurancePoundageAdjust != null)
            return false;
        if (afterMarketProductCostAdjust != null ? !afterMarketProductCostAdjust.equals(that.afterMarketProductCostAdjust) : that.afterMarketProductCostAdjust != null)
            return false;
        if (fiveStarsExtendCostAdjust != null ? !fiveStarsExtendCostAdjust.equals(that.fiveStarsExtendCostAdjust) : that.fiveStarsExtendCostAdjust != null)
            return false;
        if (lastUpdateUser != null ? !lastUpdateUser.equals(that.lastUpdateUser) : that.lastUpdateUser != null)
            return false;
        if (lastUpdateDate != null ? !lastUpdateDate.equals(that.lastUpdateDate) : that.lastUpdateDate != null)
            return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (permit != null ? permit.hashCode() : 0);
        result = 31 * result + (carCode != null ? carCode.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        result = 31 * result + (stockCode != null ? stockCode.hashCode() : 0);
        result = 31 * result + (adjustDate != null ? adjustDate.hashCode() : 0);
        result = 31 * result + (siAdjust != null ? siAdjust.hashCode() : 0);
        result = 31 * result + (financeSoftLoanAdjust != null ? financeSoftLoanAdjust.hashCode() : 0);
        result = 31 * result + (financePoundageAdjust != null ? financePoundageAdjust.hashCode() : 0);
        result = 31 * result + (insurancePoundageAdjust != null ? insurancePoundageAdjust.hashCode() : 0);
        result = 31 * result + (afterMarketProductCostAdjust != null ? afterMarketProductCostAdjust.hashCode() : 0);
        result = 31 * result + (fiveStarsExtendCostAdjust != null ? fiveStarsExtendCostAdjust.hashCode() : 0);
        result = 31 * result + (lastUpdateUser != null ? lastUpdateUser.hashCode() : 0);
        result = 31 * result + (lastUpdateDate != null ? lastUpdateDate.hashCode() : 0);
        return result;
    }
}
